package com.rzico.core.controller;

import com.alibaba.fastjson.JSONObject;
import com.rzico.annotation.Log;
import com.rzico.base.BaseController;
import com.rzico.base.CommResult;
import com.rzico.core.entity.*;
import com.rzico.core.plugin.AuthPlugin;
import com.rzico.core.plugin.MsgPlugin;
import com.rzico.core.service.*;
import com.rzico.jwt.JwtTokenUtil;
import com.rzico.util.*;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.util.*;

/**
 *  商户接口
 *
 * @author Rzico Boot
 * @version 1.0
 * @date 2019-12-02
 */
@Api(description = "商户接口")
@RestController
@Slf4j
@RequestMapping("/mch")
public class MchController extends BaseController {


    @Autowired
    private SysMchService sysMchService;

    /**
     * 获取当前账号商户资料
     *
     * @return
     */
    @ApiOperation("获取当前账号商户资料")
    @GetMapping("/getInfo/{mchId}")
    public CommResult<SysMch> getInfo(@ApiParam(name="mchId",value="商户号mchId",required=true)@PathVariable String mchId) {
        SysMch sysMch = sysMchService.findById(mchId);
        return CommResult.success(sysMch);
    }

}
